<#include "/common/coms.html" /> <@layout>
 <link href='${ctx}/static/easyui/1.3.2/themes/bootstrap/easyui.css'
              type='text/css' rel='stylesheet'>
<!-- ace styles -->
<link rel="stylesheet" href="${ctx}/static/assets/css/ace.min.css" />
 <script src='${ctx}/static/js/validator.js' type='text/javascript'></script>
 <script type="text/javascript">

    function saveModel() {
        if(Validator.Validate(document.getElementById('form1'))){
        } else {
            return;
        }
//       var m=$("#nr").val();
//        m = m.replace(/(\t)/g, "");
//       m = m.replace(/(\n)/g, "");
//        alert(m);
////        $("#xmjj").attr("value",m);
// 同步数据后可以直接取得textarea的value
        var id=document.getElementById("id").value;
        url = '';
        if(id==""){
            url = '${ctx}/mb/savewp';
        }     else{
            url = '${ctx}/mb/updatewp';
        }
        $('#form1').form('submit', {
            url : url,
            onSubmit : function() {
                return $(this).form('validate');
            },
            success : function(data) {
                alert(data);
                parent.location.reload();
            }
        });

    }
    
</script>
<body>
	<div class="page-content" style="overflow: hidden">
		<div class="row-fluid">
			<div class="span6">
				<form class="form-horizontal" id="form1" method="post">
					<input type="hidden" name="id" id="id">
					<div class="control-group">
						<label class="control-label">顺序步骤名称:</label>
						<div class="controls">
							<input id="mbsxmc" name="mbsxmc" type="text"
								style="min-height: 24px;" dataType="Require" msg="请输入商品名称"
								maxlength="20" />

						</div>
					</div>
					<div class="control-group">
						<label class="control-label">顺序步骤编码：</label>
						<div class="controls">
							${name} <input type="hidden"
								name="lbid" id="lbid" style="min-height: 24px;" value="${lbid}">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">模板编码：</label>
						<div class="controls">
							<input id="mbbh" name="mbbh" type="text"
								style="min-height: 24px;" dataType="Require" msg="请输入模板编码"
								maxlength="10" />
						</div>
					</div>
				<div class="control-group">
						<label class="control-label">显示顺序：</label>
						<div class="controls">
							<input id="dsporder" name="dsporder" type="text" 
							 class="easyui-numberbox"  dataType="Require" msg="请输入顺序"
								style="min-height: 24px;" />
						</div>
					</div> 

					<div class="control-group content">
						<div class="controls">
				           <input id="archivesfileid" name="archivesfileid" type="hidden"  value="" />
							<a class="btn btn-info btn-small" onclick="saveModel()">确定 </a>
							&nbsp; &nbsp;&nbsp;&nbsp; 
							                                <a href="#"  class="btn btn-danger btn-small bigger-110"  onclick="parent.closeDialog();"  >取消 </a>
							
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>

</body>
<script>


</script>
<script>
var id=""; 
    <#list list as m>
     id= '${(m.id)!}';
   document.getElementById("id").value  = '${(m.id)!}';
    document.getElementById("mbbh").value  =  '${(m.mbbh)!}';
    document.getElementById("mbsxmc").value  =  '${(m.mbsxmc)!}';
    document.getElementById("dsporder").value  =  '${(m.dsporder)!}';
 
    
  </#list>


</script>
</@layout>

